package com.zhangdi.dwtools.net;

import org.springframework.web.client.RestTemplate;

/**
 * Created by zhangdi on 2020/07/27 15:15:36.
 */

public class RestTempleUtil {
    private static RestTemplate template = null;
    private final static Object object = new Object();

    public static RestTemplate restTemplate() {
        if (null == template) {
            synchronized (object) {
                if (null == template) {
                    template = new RestTemplate();
                    template.getMessageConverters().add(new WxMappingJackson2HttpMessageConverter());
                }
            }
        }
        return template;
    }
}
